package com.xdjd.task.mapper.member;

import com.xdjd.task.model.member.MemberUserStepPo;
import net.oschina.durcframework.easymybatis.dao.CrudDao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface MemberUserStepPoDao extends CrudDao<MemberUserStepPo> {
    @Update("update member_user_step set today_step_number=#{stepNumber} where member_id=#{memberId}")
    int updateStepNumber(@Param("memberId") Long memberId, @Param("stepNumber") Long stepNumber);

    @Update("update member_user_step set challenge_count=challenge_count+1,is_get=1 where member_id=#{memberId} and is_get=0 and challenge_count<1")
    int addChanceCountLock(@Param("memberId") Long memberId);

    @Update("update member_user_step set total_step_number=total_step_number+today_step_number,today_step_number=0,challenge_count=0,is_get=0")
    int initUserStep();
}